package com.gokzzz.controller;

import com.gokzzz.annotation.Log;
import com.gokzzz.dto.SysQuartzLogSearchQueryDTO;
import com.gokzzz.response.Response;
import com.gokzzz.service.ISysQuartzLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author gokzzz
 * @date 2022-04-24 14:48
 */

@RestController
@Api(tags = "定时任务日志")
@RequestMapping("/system/scheduler/log")
@RequiredArgsConstructor
public class SysQuartzLogController {
    private final ISysQuartzLogService sysQuartzLogService;

    @Log("显示定时任务日志列表")
    @ApiOperation("显示定时任务日志列表")
    @PostMapping("/listLogByPage/{page}/{size}")
    public Response listLogByPage(@RequestBody SysQuartzLogSearchQueryDTO sysQuartzJobSearchQueryDTO,
                                  @PathVariable Long page,
                                  @PathVariable Long size) {

        return Response.success().setData(sysQuartzLogService.listLogByPage(sysQuartzJobSearchQueryDTO, page, size));
    }
}
